﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace affmanager {
    public partial class AddNewSiteForm : Form {
        public AddNewSiteForm() {
            InitializeComponent();
        }

        #region Properties
        private string DataFile { get; set; }
        private List<Sites> SiteData { get; set; }
        #endregion

        private void AddNewSiteForm_Load(object sender, EventArgs e) {
            DataFile = "data.ini"; //Prepare to load/write data file
            SiteData = new List<Sites>(); //Prepare to store site data
            
        }
        private void addSite_btn_Click(object sender, EventArgs e) {
            SiteData = new List<Sites>();
            
            DateTime date = DateTime.Now;
            string name = siteNameTextBox.Text;
            string url = siteUrlTextBox.Text;
            string pagerank = "";
            string age = date.ToString("d");

            List<Sites> data = new List<Sites>();
            HandleData.addNewSite(out data, name, url, pagerank, age);
            this.Close();
        }

        private void addSiteClear_btn_Click(object sender, EventArgs e) {
            siteNameTextBox.Text = "";
            sitePRComboBox.SelectedItem = "N/A";
            siteUrlTextBox.Text = "http://";
        }
    }
}
